/*
 * A child class of 'Member'
 */
import java.util.ArrayList;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Nurse extends Member{
	private ArrayList  patientID;
	
	
	//constructor
	public Nurse(String f, String l, MessageDigest p, String u, String a, int id) {
		super(f, l, p, u, a, id);
		patientID= new ArrayList();
	}
	
	
	//patient handlers
	public void addPatient(Patient pat) {
                int id = pat.getID();
                Integer tempid = (Integer) id;
		patientID.add(tempid);		//add id to ArrayList
	}
	
	
	public void removePatient(int id) {
		patientID.remove(patientID.indexOf(id));	//remove takes the index of the object to be removed
	}
	
	public int getSize()
	{
		return patientID.size();
	}
	
	public int getPatientAt(int index)
	{
		return (Integer) patientID.get(index);
	}
        
        public boolean hasPatient(int id)
        {
            //checks all contained patients' ids for hte incoming parameter
            for(int i = 0; i < patientID.size(); i++)
		{
			if(patientID.get(i).equals(id))
			{
				return true;
			}  
		}
		return false;
        }
	
	/*
	public void setPatient(int id) {		//updates if a patient's info changes (will this work? needed?)
		removePatient(id);
		addPatient(id);
	}
	*/
}
